﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    public static class GetPlane
    {

        #region Get Planes


        static testdbsEntities ctx = new testdbsEntities();

        public static List<Plane> GetPlanes()
        {
            
                IQueryable<Plane> tPlane = from cs in ctx.Plane

                                           select cs;
                return tPlane.ToList();
        }


        public static List<Plane> GetPlanes(Plane mPlane)
        {
            
            {
                IQueryable<Plane> tPlane = from cs in ctx.Plane
                                           where cs == mPlane
                                           select cs;
                return tPlane.ToList();
            }
        }

        public static List<Plane> GetPlanesByName(string mName)
        {
            
            {
                IQueryable<Plane> tPlane = from cs in ctx.Plane
                                           where cs.name == mName
                                           select cs;
                return tPlane.ToList();
            }
        }

        public static List<Plane> GetPlanesById(int id)
        {
            
            {
                IQueryable<Plane> tPlane = from cs in ctx.Plane
                                           where cs.id_plane == id
                                           select cs;
                return tPlane.ToList();
            }
        }


       


        #endregion

    }
}
